﻿<Window x:Class="Toastify.Toast"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Toastify" Height="75" Width="300" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="#00000000" ShowInTaskbar="False" Loaded="Window_Loaded" Opacity="0" 
    MouseEnter="Window_MouseEnter" MouseLeave="Window_MouseLeave" MouseDown="Window_MouseDown" MouseUp="Window_MouseUp" Cursor="Hand" Topmost="True">

    <!-- maintain TopMost="True" as per http://www.programmingtidbits.com/post/2013/01/05/Setting-WPF-Window-to-be-Always-on-Top.aspx -->
    <Window.Triggers>
        <EventTrigger RoutedEvent="Window.LostFocus">
            <BeginStoryboard>
                <Storyboard>
                    <BooleanAnimationUsingKeyFrames>
                        <DiscreteBooleanKeyFrame KeyTime="0"
                                                 Value="True"
                                                 Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
                                                 Storyboard.TargetProperty="Topmost"/>
                    </BooleanAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>

    <Border Name="ToastBorder" BorderBrush="#FF292929" BorderThickness="1" CornerRadius="4">
        <Border.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <GradientStop Color="#FF999999" Offset="0"/>
                <GradientStop Color="#FF353535" Offset="1"/>
            </LinearGradientBrush>
        </Border.Background>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="20"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Image Name="LogoToast" Stretch="Fill" Grid.Column="0" Width="55" Height="55" Margin="10,0,0,0" Source="SpotifyToastifyLogo.png" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image.BitmapEffect>
                    <DropShadowBitmapEffect ShadowDepth="1" Softness="0.1" />
                </Image.BitmapEffect>
            </Image>
            <Grid Grid.Column="2" Margin="0,15,0,15">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Name="Title1" Grid.Row="0" Foreground="White" FontSize="16" TextTrimming="CharacterEllipsis"><TextBlock.BitmapEffect><DropShadowBitmapEffect ShadowDepth="2" Softness="0.1" /></TextBlock.BitmapEffect>Body (feat. DJ Rush)</TextBlock>
                <TextBlock Name="Title2" Grid.Row="1" Foreground="White" FontSize="12" TextTrimming="CharacterEllipsis">Si Begg</TextBlock>
            </Grid>
        </Grid>
    </Border>
</Window>
